<?php
declare (strict_types=1);

namespace app\user\service\user\admin;

use app\common\service\BaseService;
use app\user\logic\user\admin\Credit as CreditLogic;
use think\annotation\Inject;
use think\facade\Request;

/**
 * Class Credit
 *
 * @package app\user\service\user\admin
 */
class Credit extends BaseService
{
    /**
     * @Inject()
     *
     * @var CreditLogic
     */
    protected $creditLogic;

    public function setCredit(int $userId)
    {
        $credit = Request::put('credit');
        $this->creditLogic->setUserCredit($userId, $credit);

        return $this->parseTodata([], 1, '变更成功');
    }
}